package com.gcxy.dto.resources;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 资源权限数据传输对象
 *
 * @author pep7chiao
 * @date 2022/9/27
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AddResourceDTO {

    @ApiModelProperty(value = "资源名称")
    @NotBlank(message = "资源名称必填")
    @Size(min = 1, max = 20, message = "资源名称字符串长度必须在1到20之间")
    private String resourceName;

    @ApiModelProperty(value = "资源路径")
    @NotBlank(message = "资源路径必填")
    @Size(min = 1, max = 100, message = "资源路径字符串长度必须在1到100之间")
    private String resourcePath;

    @ApiModelProperty(value = "资源类型")
    @NotNull(message = "资源类型必填")
    @Range(min = 1,max = 3,message = "没有该资源类型")
    private Integer resourceType;

    @ApiModelProperty(value = "资源描述")
    @Size(min = 0, max = 100, message = "资源描述字符串长度必须在1到100之间")
    private String description;

    @ApiModelProperty(value = "父资源id")
    @NotNull(message = "父资源id必填")
    @Min(value = 0,message = "父资源id必填不能小于0")
    private Integer parentId;

}
